package com.kcht.itsed.mws.persist.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kcht.itsed.mws.extendmodel.jpa.BufferedReportEntity;
import org.apache.ibatis.annotations.Select;

import java.util.Optional;


public interface IBufferedReportDao extends BaseMapper<BufferedReportEntity> {

	@Select("select count(1) from T_BUFFERED_REPORT where SUBSCRIBER_URL=#{url} limit 0,1")
	Optional<BufferedReportEntity> fetchLastBufferedReportEntity(String url);

	@Select("select count(*) from T_BUFFERED_REPORT where SUBSCRIBER_URL=#{url}")
	int getBufferedCount(String url);
}
